package clients;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Random;

import barsbieres.Bar;
import barsbieres.Biere;

public class ClientMoyen extends Client {

	protected final int FIDELITE = 50;

	private ArrayList<Bar> bars;

	public ClientMoyen(LinkedList<Biere> bieres) {
		super(bieres);
	}

	@Override
	public void choisitBar(ArrayList<Bar> listeBars) {
		setBar(null);
		for (Bar bar : bars) {
			if (getBar() == null) {
				int random = new Random().nextInt(100);
				if (random < FIDELITE) {
					setBar(bar);
				}
			}
		}
		if (getBar() == null) {
			listeBars.get(new Random().nextInt(listeBars.size()));
		}

	}

	@Override
	public void satisfaction(Bar b, boolean satisfait) {
		// TODO Auto-generated method stub

	}

	protected int getFidelite() {
		return this.FIDELITE;
	}

}
